# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models

class Migration(SchemaMigration):
    
    def forwards(self, orm):
        
        # Adding model 'Queue'
        db.create_table('foxtail_queue', (
            ('position', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=512)),
        ))
        db.send_create_signal('foxtail', ['Queue'])

        # Adding model 'MQTask'
        db.create_table('foxtail_mqtask', (
            ('status', self.gf('django.db.models.fields.CharField')(default='pending', max_length=255)),
            ('priority', self.gf('django.db.models.fields.IntegerField')(default=0)),
            ('modified_by', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('name', self.gf('django.db.models.fields.CharField')(max_length=512)),
            ('created', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
            ('modified', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
            ('created_by', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
            ('payload', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
            ('queue', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['foxtail.Queue'])),
            ('position', self.gf('django.db.models.fields.IntegerField')(null=True, blank=True)),
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
        ))
        db.send_create_signal('foxtail', ['MQTask'])
    
    
    def backwards(self, orm):
        
        # Deleting model 'Queue'
        db.delete_table('foxtail_queue')

        # Deleting model 'MQTask'
        db.delete_table('foxtail_mqtask')
    
    
    models = {
        'foxtail.mqtask': {
            'Meta': {'object_name': 'MQTask'},
            'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'created_by': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'modified': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
            'modified_by': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
            'payload': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'position': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'queue': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['foxtail.Queue']"}),
            'status': ('django.db.models.fields.CharField', [], {'default': "'pending'", 'max_length': '255'})
        },
        'foxtail.queue': {
            'Meta': {'object_name': 'Queue'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '512'}),
            'position': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})
        }
    }
    
    complete_apps = ['foxtail']
